package vno.fux.res.pool
{	
	import flash.utils.Dictionary;
	
	import vno.fux.res.manager.LoadState;
	import vno.fux.res.manager.ResourceManager;
	public class SoundResource extends Resource
	{		
		use namespace RM_SRM;
		RM_SRM var _bgm:SoundTarget;
		public function SoundResource(id_:uint)
		{
			super(id_);
		}
		
		public function get bgm():SoundTarget
		{
			if(_loadStateDic[_bgm] == LoadState.NOT_LOAD)
			{
				_loadStateDic[_bgm] = LoadState.PRE_LOAD;
				ResourceManager.getInstance().snd.load(id);
			}
			return _bgm;
		}
		
		override public function create():void
		{
			this._loadStateDic = new Dictionary(true);
			_bgm = new SoundTarget;
			this._loadStateDic[_bgm] = LoadState.NOT_LOAD;
		}
		
		override public function destroy():void
		{
			_bgm = null;
			this._loadStateDic = null;
		}
	}
}